package com.agstar.simplefactory;

/**
 * 一个家具工厂，用于制造各种家具
 *
 * @author rcl
 * @date 2019/7/5 9:17
 */
public class FurnitureFactory {


    public static void main(String[] args) {
        Furniture furnitrue = FurnitureFactory.create("computer");
        furnitrue.bootUp();
    }


    public static Furniture create(String name) {
        if ("friger".equals(name)) {
            return new Frige();
        } else if ("television".equals(name)) {
            return new Television();
        } else if ("computer".equals(name)) {
            return new Computer();
        }
        return null;
    }


}
